{% set dmvpn_crypto_key = admin_password | hash('md5') %}
{% set dmvpn_network = "10.255.0.0/24" %}
!
crypto isakmp policy 10
 encr aes 256
 hash sha256
 authentication pre-share
 group 2
crypto isakmp key {{ dmvpn_crypto_key }} address 0.0.0.0
!
!
crypto ipsec transform-set {{ dmvpn_transform_set | default('xform')}} esp-aes 256 esp-sha256-hmac
 mode transport
!
router ospf 1
 network {{ dmvpn_network | ansible.netcommon.ipaddr('network')}} 0.0.0.255 area 1
!
crypto ipsec profile {{ dmvpn_ipsec_profile | default('ipsec-prof')}}
 set transform-set {{ dmvpn_transform_set | default('xform')}}
!
interface Tunnel2
 ip address {{ dmvpn_network | ansible.netcommon.ipaddr(254) | ansible.netcommon.ipaddr('address') }} {{ dmvpn_network | ansible.netcommon.ipaddr('netmask') }}
 no ip redirects
 ip mtu 1400
 ip ospf network broadcast
 ip ospf hello-interval 30
 ip ospf priority 255
 ip nhrp authentication {{ dmvpn_transform_set | default('xform')}}
 ip nhrp map multicast dynamic
 ip nhrp network-id 1
 ip nhrp redirect
 ip tcp adjust-mss 1360
 tunnel source GigabitEthernet1
 tunnel mode gre multipoint
 tunnel key 1
 tunnel protection ipsec profile {{ dmvpn_ipsec_profile | default('ipsec-prof')}}
end
